/*
  LinPVR - Linux Personal Video Recorder
  Copyright (C) 2006 Kamil Pawlowski <kamilpe@gmail.com>

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
*/
#ifndef _AUDIO_H_
#define _AUDIO_H_

#include <alsa/asoundlib.h>

#define AUDIO_SAMPLES  512
#define AUDIO_CAPTURE  SND_PCM_STREAM_CAPTURE
#define AUDIO_PLAYBACK SND_PCM_STREAM_PLAYBACK

typedef struct audiodev_s {
  snd_pcm_t     *device;
  short         *buf;

  int            rate;
  int            channels;
} audiodev_t;

int  audiodev_open(audiodev_t *device, const char *handle, int channels, int rate, int mode);
void audiodev_close(audiodev_t *device);

#endif
